/*-------------------------------------------------------------------------

***************** Modification History ***********************************
   @doc
   @module clrkrpts.h - Header file for application report functions |
   @end
   
$Log: /SoftPay/SPK2SIM/Source/Include/clrkrpts.h $ 
**************************************************************************
 
   Copyright (C) 1999 by VeriFone, Inc.

   All rights reserved.  No part of this software may be reproduced,
   transmitted, transcribed, stored in a retrieval system, or translated
   into any language or computer language, in any form or by any means,
   electronic, mechanical, magnetic, optical, chemical, manual or otherwise,
   without the prior written permission of VeriFone, Inc.

---------------------------------------------------------------------------*/

#ifndef CLRKRPTS_H
#define CLRKRPTS_H

#include <udt.h>
#include <transact.h>
#include <print.h>
#include <report.h> /* for DETAIL_TOTALS*/

#define MAX_ACTIVE_CLERK   100            /* Max number of Clerk whose trans. is in the current batch file */


typedef struct TagACTIVE_CLERK
{
    char szClerkID[CLERK_ID_SIZE + 1];
} ACTIVE_CLERK;

#define SIZE_ACTIVE_CLERK     sizeof(ACTIVE_CLERK)

typedef struct
{
    char szClerkID[CLERK_ID_SIZE + 1];
    int  inCount;                          /* Number of tran done */
    long lnTotAmt;                         /* Base+Tax+Tip+CB+Surcharge */
    long lnBaseAmt;                        /* Base Amount */
    long lnTaxAmt;                         /* Tax amount */
    long lnTipAmt;                         /* Tip Amount */
    long lnCashBack;                       /* Cash Back amount  */
    long lnSurcharge;                      /* Surcharge amount  */
    long lnTipSale;                        /* TotalofTransaction (when tip > 0) */
} CLERK_TOTS_REC;

#define SIZE_CLERK_TOTS_REC     sizeof(CLERK_TOTS_REC)
#define CLERK_REPORT 1

typedef struct
{
    long    lnTipAmt;
    long    lnNetTipTot;
    long    lnTipTot;
    long    lnGrandAmt;
} DISCTIP_TOTALS;

int inClerkTotalsReportOperation (TRANSACTION_OBJECT *pobTran);
int inClerkDetailReportOperation (TRANSACTION_OBJECT *pobTran);
int inClerkTableReportOperation (TRANSACTION_OBJECT *pobTran);
int inClerkReviewOperation (void);
void vdSetClerkTotalHeaderCondition (int inReportTop, int inGrandTotals);
void vdSetClerkTotalMiddleCondition (void);
void vdSetClerkTotalBottomCondition (TRANSACTION_OBJECT *pobTran, int inFormFeed, long lnSurcharge, long lnTaxTotal);
int inPrintClerkTotalsRecord (PRINTER_OBJECT *obPrinter, CLERK_TOTS_REC *srClerkTots, int inShift, char *szClerkId);
int inPrintClerkTotalsBottom (TRANSACTION_OBJECT *pobTran, PRINTER_OBJECT *obPrinter, CLERK_TOTS_REC *psrClerkTots, int inFormFeed);
int inPrintClerkTotalsReport (TRANSACTION_OBJECT *pobTran, PRINTER_OBJECT *obPrinter);
void vdSetClerkTableHeaderCondition (void);
void vdSetClerkTableMiddleCondition (void);
int inPrintClerkTableReport (PRINTER_OBJECT *obPrinter, TRANSACTION_OBJECT *pobTran);
void vdSetIRSTipHeaderCondition (VS_BOOL fTotals);
void vdSetIRSTipBottomCondition (void);
void vdSetIRSNoTransCondition (void);
int inCombineActiveClerks(void);
int inPrintIRSTipOneClerk (PRINTER_OBJECT *obPrinter, char *szClerkId, long lnTipSale, long lnTipAmount, long lnCashTipAmt);
int inPrintIRSGrandTotals (PRINTER_OBJECT *obPrinter, long lnTipSale, long lnTipAmount, long lnCashTipAmt);
void vdSetClerkHeaderCondition (int inReportTop, int inReportType, int inNewClerk, int inCurrencyFlag);
void vdSetClerkMiddleCondition (TRANSACTION_OBJECT *pobTran);
int inGetClerkSelection(char *pszClerkId);
int inPrintClerkDetailReport (TRANSACTION_OBJECT *pobTran, PRINTER_OBJECT *obPrinter);
int inPrintSingleClerk (PRINTER_OBJECT *obPrinter, TRANSACTION_OBJECT *pobTran, DETAIL_TOTALS *psrDetTot);
int inPrintSingleClerkTipDisc (PRINTER_OBJECT *obPrinter, TRANSACTION_OBJECT *pobTran, DISCTIP_TOTALS *psrTot);
void vdSetClerkTipHeaderCondition (int inReportTop, int inReportType, int inNewClerk);
int inPrintDiscountTipReport (TRANSACTION_OBJECT *pobTran, PRINTER_OBJECT *obPrinter);
int inDiscountTipReportOperation (TRANSACTION_OBJECT *pobTran);
int inIRSTipReportOperation (TRANSACTION_OBJECT *pobTran);
int inPrintIRSTipReport(PRINTER_OBJECT *obPrinter, TRANSACTION_OBJECT * pobTran);
void vdMakeDiscTipMiddle (TRANSACTION_OBJECT *pobTran, DISCTIP_TOTALS *psrTot);
int inIRSTipProc (char *szClerkId);
int inGetClerkTemplate(void);
int inAddActiveClerk (char szClerkId[CLERK_ID_SIZE + 1], char chShift, ACTIVE_CLERK srActiveClerk[MAX_ACTIVE_CLERK]);
int CLRKRPTS_CODE_CHECK(char * a,char *b,short *  c,char * d,unsigned char * e);
int inPrintClerkReportHeader (TRANSACTION_OBJECT *pobTran, PRINTER_OBJECT *obPrinter);

#endif		/* CLRKRPTS_H */


